/*
 * Copyright 2008-2015 GuanAiHui inc. 
 */
package com.pretty.adminapp.pojo.model.um;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.pretty.adminapp.pojo.base.AutoIdBaseEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Privilege:
 *
 * @author Dennis Ge
 */
@Entity
@Table(name = "um_permission")
@DynamicInsert
@DynamicUpdate
public class Permission extends AutoIdBaseEntity {

	@Column(name = "code")
	private String code;

	@Column(name = "name")
	private String name;
	@ManyToOne
	@JoinColumn(name = "module_id", insertable=false, updatable=false)
	private Module module;
	
	@Column(name="module_id")
	private Long moduleId;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Module getModule() {
		return module;
	}

	public void setModule(Module module) {
		this.module = module;
	}

	public Long getModuleId() {
		return moduleId;
	}

	public void setModuleId(Long moduleId) {
		this.moduleId = moduleId;
	}

	@Override
	public String toString() {
		return "Permission [code=" + code + ", name=" + name + ", module=" + module + "]";
	}

}
